<template>
  <div>
    <!-- 分类导航 -->
    <TypeNav></TypeNav>
    <!-- 列表 -->
    <ListContainer></ListContainer>
    <!-- 今日推荐 -->
    <TodayRecommend></TodayRecommend>
    <!-- 商品排行 -->
    <GoodsRank></GoodsRank>
    <!-- 猜你喜欢 -->
    <GuessLike></GuessLike>
    <!-- 楼层： -->
    <FloorView v-for="floor in floorList" :key="floor.id" :list="floor"></FloorView>
    <!-- 商标 -->
    <BrandView></BrandView>
  </div>
</template>

<script>
import ListContainer from './modules/ListContainer.vue';
import TodayRecommend from './modules/TodayRecommend.vue';
import GoodsRank from './modules/GoodsRank.vue';
import GuessLike from './modules/GuessLike.vue';
import FloorView from './modules/FloorView.vue';
import BrandView from './modules/BrandView.vue';

import { mapState } from "vuex";


export default {
  name: 'HomeView',
  components: {
    ListContainer,
    TodayRecommend,
    GoodsRank,
    GuessLike,
    FloorView,
    BrandView
  },
  //组件挂载完毕
  mounted(){
    // 派发action,获取floor组件数据
    this.$store.dispatch('getFloorList')
    // // 获取用户信息在首页展示
    // this.$store.dispatch('getFloorList')
  },
  computed:{
    ...mapState({
      floorList:state=>state.home.floorList
    })
  }
};
</script>

<style scoped lang="less"></style>